import { mineInfor } from '../../request/api.js'
export default{
	namespaced: true,
	state:{
		myInfor:"",
		imgUrl:"http://192.168.1.29:8080",
		haveLogin:false,
		language:uni.getStorageSync('language')?uni.getStorageSync('token'):'0'
	},
	getters:{
		
	},
	mutations:{
		CHANGE_LOGIN_STATUS(state,e){
			state.haveLogin=e;
		},
		CHANGE_MY_INFOR(state,e){
			state.myInfor=e;
		}
	},
	actions:{
		async getMyInfor(context){
			let res= await mineInfor();
			if(res.code==1){
				context.commit("CHANGE_MY_INFOR",res.data);
				uni.setStorageSync('myInfor',JSON.stringify(res.data));
			}
		}
	}
}